package com.lg.atp.utils;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;


public class DeviceUtil {

	public static String getDemoServerScriptUrl(String ip, Integer port,
			Long scriptId) {
		return "http://" + ip + ":" + port + "/wsServices/getScript/"
				+ scriptId;
	}
	//参数化
	public static String getDemoServerScriptUrl(String ip, Integer port,
			String uuid) {
		return "http://" + ip + ":" + port + "/wsServices/getappById/"
				+ uuid;
	}
	
	public static String getDemoServerAppUrl(String ip, Integer port, Long appId) {
		return "http://" + ip + ":" + port + "/wsServices/getappById/"
				+ appId;
	}

	public static String getDemoServerResultUrl(String ip, Integer port,
			Long caseId, Long caseResultId) {
		return "http://" + ip + ":" + port + "/wsServices/getresultById/"
				+ caseId + "/" + caseResultId;
	}

	public static String getDemoJobStatusUrl(String ip, Integer port) {
		return "http://" + ip + ":" + port + "/demo/services/wsdevice/status/";
	}

	public static String getMatcServer(String ip, Integer port) {
		return "http://" + ip + ":" + port + "/api/matc/jobs/add";
	}


	/**
	 * 
	 * @param status
	 * @return
	 */
	public static Integer convertAutoTestResultToOwn(String status) {
		if ("passed".equals(status)) {
			return 3;
		}
		if ("failed".equals(status)) {
			return 4;
		}
		return 1;
	}
}
